/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model.impl;

import com.crossriver.crgis.database.model.Organisation_Information;
import com.crossriver.crgis.database.model.Organisation_InformationModel;
import com.crossriver.crgis.database.model.Organisation_InformationSoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * The base model implementation for the Organisation_Information service. Represents a row in the &quot;CRGIA_Organisation_Information&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.crossriver.crgis.database.model.Organisation_InformationModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link Organisation_InformationImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a organisation_ information model instance should use the {@link com.crossriver.crgis.database.model.Organisation_Information} interface instead.
 * </p>
 *
 * @author Wole Adetiba
 * @see Organisation_InformationImpl
 * @see com.crossriver.crgis.database.model.Organisation_Information
 * @see com.crossriver.crgis.database.model.Organisation_InformationModel
 * @generated
 */
public class Organisation_InformationModelImpl extends BaseModelImpl<Organisation_Information>
	implements Organisation_InformationModel {
	public static final String TABLE_NAME = "CRGIA_Organisation_Information";
	public static final Object[][] TABLE_COLUMNS = {
			{ "applicationId", new Integer(Types.VARCHAR) },
			{ "userId", new Integer(Types.VARCHAR) },
			{ "organisationName", new Integer(Types.VARCHAR) },
			{ "natureOfBusiness", new Integer(Types.VARCHAR) },
			{ "regNo", new Integer(Types.VARCHAR) },
			{ "countryOfReg", new Integer(Types.VARCHAR) },
			{ "dateOfRegistration", new Integer(Types.TIMESTAMP) }
		};
	public static final String TABLE_SQL_CREATE = "create table CRGIA_Organisation_Information (applicationId VARCHAR(75) not null primary key,userId VARCHAR(75) null,organisationName VARCHAR(75) null,natureOfBusiness VARCHAR(75) null,regNo VARCHAR(75) null,countryOfReg VARCHAR(75) null,dateOfRegistration DATE null)";
	public static final String TABLE_SQL_DROP = "drop table CRGIA_Organisation_Information";
	public static final String ORDER_BY_JPQL = " ORDER BY organisation_Information.applicationId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CRGIA_Organisation_Information.applicationId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.crossriver.crgis.database.model.Organisation_Information"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.crossriver.crgis.database.model.Organisation_Information"),
			true);

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static Organisation_Information toModel(
		Organisation_InformationSoap soapModel) {
		Organisation_Information model = new Organisation_InformationImpl();

		model.setApplicationId(soapModel.getApplicationId());
		model.setUserId(soapModel.getUserId());
		model.setOrganisationName(soapModel.getOrganisationName());
		model.setNatureOfBusiness(soapModel.getNatureOfBusiness());
		model.setRegNo(soapModel.getRegNo());
		model.setCountryOfReg(soapModel.getCountryOfReg());
		model.setDateOfRegistration(soapModel.getDateOfRegistration());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<Organisation_Information> toModels(
		Organisation_InformationSoap[] soapModels) {
		List<Organisation_Information> models = new ArrayList<Organisation_Information>(soapModels.length);

		for (Organisation_InformationSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.crossriver.crgis.database.model.Organisation_Information"));

	public Organisation_InformationModelImpl() {
	}

	public String getPrimaryKey() {
		return _applicationId;
	}

	public void setPrimaryKey(String pk) {
		setApplicationId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _applicationId;
	}

	public String getApplicationId() {
		if (_applicationId == null) {
			return StringPool.BLANK;
		}
		else {
			return _applicationId;
		}
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getUserId() {
		if (_userId == null) {
			return StringPool.BLANK;
		}
		else {
			return _userId;
		}
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getOrganisationName() {
		if (_organisationName == null) {
			return StringPool.BLANK;
		}
		else {
			return _organisationName;
		}
	}

	public void setOrganisationName(String organisationName) {
		_organisationName = organisationName;
	}

	public String getNatureOfBusiness() {
		if (_natureOfBusiness == null) {
			return StringPool.BLANK;
		}
		else {
			return _natureOfBusiness;
		}
	}

	public void setNatureOfBusiness(String natureOfBusiness) {
		_natureOfBusiness = natureOfBusiness;
	}

	public String getRegNo() {
		if (_regNo == null) {
			return StringPool.BLANK;
		}
		else {
			return _regNo;
		}
	}

	public void setRegNo(String regNo) {
		_regNo = regNo;
	}

	public String getCountryOfReg() {
		if (_countryOfReg == null) {
			return StringPool.BLANK;
		}
		else {
			return _countryOfReg;
		}
	}

	public void setCountryOfReg(String countryOfReg) {
		_countryOfReg = countryOfReg;
	}

	public Date getDateOfRegistration() {
		return _dateOfRegistration;
	}

	public void setDateOfRegistration(Date dateOfRegistration) {
		_dateOfRegistration = dateOfRegistration;
	}

	public Organisation_Information toEscapedModel() {
		if (isEscapedModel()) {
			return (Organisation_Information)this;
		}
		else {
			return (Organisation_Information)Proxy.newProxyInstance(Organisation_Information.class.getClassLoader(),
				new Class[] { Organisation_Information.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Organisation_InformationImpl organisation_InformationImpl = new Organisation_InformationImpl();

		organisation_InformationImpl.setApplicationId(getApplicationId());

		organisation_InformationImpl.setUserId(getUserId());

		organisation_InformationImpl.setOrganisationName(getOrganisationName());

		organisation_InformationImpl.setNatureOfBusiness(getNatureOfBusiness());

		organisation_InformationImpl.setRegNo(getRegNo());

		organisation_InformationImpl.setCountryOfReg(getCountryOfReg());

		organisation_InformationImpl.setDateOfRegistration(getDateOfRegistration());

		return organisation_InformationImpl;
	}

	public int compareTo(Organisation_Information organisation_Information) {
		int value = 0;

		value = getApplicationId()
					.compareTo(organisation_Information.getApplicationId());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Organisation_Information organisation_Information = null;

		try {
			organisation_Information = (Organisation_Information)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = organisation_Information.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(15);

		sb.append("{applicationId=");
		sb.append(getApplicationId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", organisationName=");
		sb.append(getOrganisationName());
		sb.append(", natureOfBusiness=");
		sb.append(getNatureOfBusiness());
		sb.append(", regNo=");
		sb.append(getRegNo());
		sb.append(", countryOfReg=");
		sb.append(getCountryOfReg());
		sb.append(", dateOfRegistration=");
		sb.append(getDateOfRegistration());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(25);

		sb.append("<model><model-name>");
		sb.append(
			"com.crossriver.crgis.database.model.Organisation_Information");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>organisationName</column-name><column-value><![CDATA[");
		sb.append(getOrganisationName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>natureOfBusiness</column-name><column-value><![CDATA[");
		sb.append(getNatureOfBusiness());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>regNo</column-name><column-value><![CDATA[");
		sb.append(getRegNo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>countryOfReg</column-name><column-value><![CDATA[");
		sb.append(getCountryOfReg());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>dateOfRegistration</column-name><column-value><![CDATA[");
		sb.append(getDateOfRegistration());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _applicationId;
	private String _userId;
	private String _organisationName;
	private String _natureOfBusiness;
	private String _regNo;
	private String _countryOfReg;
	private Date _dateOfRegistration;
}